#include"Reactor.hpp"
#include"listener.hpp"
#include"connection.hpp"
#include"Channel.hpp"
#include<memory>
int main(int argc,char* argv[]){
    if(argc!=2){
        std::cout<<"Usage: "<<argv[0]<<" port"<<std::endl;
        return 1;
    }
    int port=atoi(argv[1]);
   std::shared_ptr<connection> listener=std::make_shared<Listener>(port,[](std::shared_ptr<connection> conn){
    //来了新的连接，直接俩接到worker线程里面
    //然后在worker处理
    //先进Deque里面,在eventfd;
     std::cout<<"新链接到来"<<std::endl;
   });
   std::unique_ptr<Reactor> reactor=std::make_unique<Reactor>();
   reactor->addconnection(listener);
   reactor->start();
   return 0;
}